class Account < ActiveRecord::Base
  has_many :burndowns
  belongs_to :user
  validates_presence_of :user_id
  
  def validate
    basecamp = BasecampWrapper.create_wrapper
    unless basecamp.connect!(:url => url, :username => username, :password => password)
      errors.add_to_base("The basecamp account parameters seem to be invalid.")
    end
  end
  
end
